<template>
	<view class="">
		<u-swiper :list="info.image" height="500"></u-swiper>
		
		<view style="padding: 30rpx;">
			<view style="font-size: 32rpx;font-weight: bold;">{{info.title}}</view>
			<view style="color: #999;margin-top: 10rpx;">{{info.des}}</view>
		</view>
		
		<u-gap height="10" bg-color="#f1f1f1"></u-gap>
		
		
		<u-cell-group>
			<u-cell-item  title="地址" :arrow="false" :value="info.address">
			
			</u-cell-item>
			<u-cell-item  title="电话" :arrow="false">	
					<text>{{info.phone}}</text>
					<text class="call" @click="call">拨打</text>
			</u-cell-item>
		</u-cell-group>
		
		<u-gap height="10" bg-color="#f1f1f1"></u-gap>
		
		<view class="u-margin-20">
			<title :txt="txt" ></title>
		</view>
		
	   <u-parse :html="info.detail"></u-parse>
		
		
	</view>
</template>

<script>
	
	
	import title from '../../components/title.vue';

	export default{
		components:{
			title
		},
		data(){
			return{
				info:{
					
				},
				current:"",
				txt:""
			}
		},
		onLoad(options) {
			if(options.id){
				this.id=options.id
			}
			
			if(options.current){	
				var current=Number(options.current);
				uni.setNavigationBarTitle({
					title:current==2?'饭店详情':'物流详情'
				})
				this.txt=current==2?'饭店介绍':"公司介绍"
			}
			
			this.get()
		},
		methods:{
			get(){
				this.$u.post('/api/index/adDetail', {
                     ad_id:this.id				   
				}).then(res => {
					this.info=res.data
				}).catch(err => {
				
				})
			},
			call(){
				uni.makePhoneCall({
					phoneNumber:this.info.phone
				})
			}
		}
	}
</script>
   

<style>
	.call{
		width: 80rpx;
		height: 40rpx;
		background: #037705;
		border-radius: 30rpx;
		display: inline-block;
		text-align: center;
		color: #FFFFFF;
		line-height: 40rpx;
		margin-left: 20rpx;
	}
</style>
